# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.CloudControlsPartner.V1.Model.Workload do
  @moduledoc """
  Contains metadata around the [Workload resource](https://cloud.google.com/assured-workloads/docs/reference/rest/Shared.Types/Workload) in the Assured Workloads API.

  ## Attributes

  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. Time the resource was created.
  *   `folder` (*type:* `String.t`, *default:* `nil`) - Output only. The name of container folder of the assured workload
  *   `folderId` (*type:* `String.t`, *default:* `nil`) - Output only. Folder id this workload is associated with
  *   `isOnboarded` (*type:* `boolean()`, *default:* `nil`) - Indicates whether a workload is fully onboarded.
  *   `keyManagementProjectId` (*type:* `String.t`, *default:* `nil`) - The project id of the key management project for the workload
  *   `location` (*type:* `String.t`, *default:* `nil`) - The Google Cloud location of the workload
  *   `name` (*type:* `String.t`, *default:* `nil`) - Identifier. Format: `organizations/{organization}/locations/{location}/customers/{customer}/workloads/{workload}`
  *   `partner` (*type:* `String.t`, *default:* `nil`) - Partner associated with this workload.
  *   `workloadOnboardingState` (*type:* `GoogleApi.CloudControlsPartner.V1.Model.WorkloadOnboardingState.t`, *default:* `nil`) - Container for workload onboarding steps.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :createTime => DateTime.t() | nil,
          :folder => String.t() | nil,
          :folderId => String.t() | nil,
          :isOnboarded => boolean() | nil,
          :keyManagementProjectId => String.t() | nil,
          :location => String.t() | nil,
          :name => String.t() | nil,
          :partner => String.t() | nil,
          :workloadOnboardingState =>
            GoogleApi.CloudControlsPartner.V1.Model.WorkloadOnboardingState.t() | nil
        }

  field(:createTime, as: DateTime)
  field(:folder)
  field(:folderId)
  field(:isOnboarded)
  field(:keyManagementProjectId)
  field(:location)
  field(:name)
  field(:partner)

  field(:workloadOnboardingState,
    as: GoogleApi.CloudControlsPartner.V1.Model.WorkloadOnboardingState
  )
end

defimpl Poison.Decoder, for: GoogleApi.CloudControlsPartner.V1.Model.Workload do
  def decode(value, options) do
    GoogleApi.CloudControlsPartner.V1.Model.Workload.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.CloudControlsPartner.V1.Model.Workload do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
